package model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the carrello database table.
 * 
 */
@Embeddable
public class CarrelloPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="id_carrello")
	private int idCarrello;

	@Column(name="id_pacchetto")
	private int idPacchetto;

	public CarrelloPK() {
	}
	
	
	
	public CarrelloPK(int idCarrello, int idPacchetto) {
		super();
		this.idCarrello = idCarrello;
		this.idPacchetto = idPacchetto;
	}



	public int getIdCarrello() {
		return this.idCarrello;
	}
	public void setIdCarrello(int idCarrello) {
		this.idCarrello = idCarrello;
	}
	public int getIdPacchetto() {
		return this.idPacchetto;
	}
	public void setIdPacchetto(int idPacchetto) {
		this.idPacchetto = idPacchetto;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CarrelloPK)) {
			return false;
		}
		CarrelloPK castOther = (CarrelloPK)other;
		return 
			(this.idCarrello == castOther.idCarrello)
			&& (this.idPacchetto == castOther.idPacchetto);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idCarrello;
		hash = hash * prime + this.idPacchetto;
		
		return hash;
	}
}